package com.haochang.chunkvod.controller.activity.hostess;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;

import com.haochang.base.BaseListView;
import com.haochang.base.BaseTextView;
import com.haochang.chunkvod.R;
import com.haochang.chunkvod.controller.adapter.base.BaseAdapterHelper;
import com.haochang.chunkvod.controller.adapter.base.QuickAdapter;
import com.haochang.chunkvod.tools.vod.other.DipPxConversion;
import com.haochang.chunkvod.view.vod.dialog.VodCustomDialog;

import java.util.ArrayList;

/**
 * Created by xt01 on 2016/11/9.
 */
public class Test extends Activity
{
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		new VodCustomDialog.Builder(this).setTitle("预付详情").showDialog(R.layout.inflate_vod_custom_dialog_advanced_pay, new VodCustomDialog.OnViewAddedListener()
		{
			@Override
			public void getView(View view)
			{
				((BaseTextView) view.findViewById(R.id.tv_cash)).setText(String.valueOf("现金:¥" + "555.00"));
				((BaseTextView) view.findViewById(R.id.tv_swiping_card)).setText(String.valueOf("刷卡:¥" + "555.00"));
				((BaseTextView) view.findViewById(R.id.tv_alipay)).setText(String.valueOf("支付宝:¥" + "555.00"));
				((BaseTextView) view.findViewById(R.id.tv_wchat_pay)).setText(String.valueOf("微信:¥" + "555.00"));
				((BaseTextView) view.findViewById(R.id.tv_membership_card)).setText(String.valueOf("会员卡:¥" + "555.00"));
			}
		});
		new VodCustomDialog.Builder(this).setTitle("券详情").showDialog(R.layout.inflate_vod_custom_dialog_listview, new VodCustomDialog.OnViewAddedListener()
		{
			@Override
			public void getView(View view)
			{
				((BaseListView) view.findViewById(R.id.listView))
						.setAdapter(new QuickAdapter<Object>(Test.this, R.layout.item_ticket_detail, new ArrayList<Object>())
						{
							@Override
							protected void convert(BaseAdapterHelper helper, Object object)
							{
								helper.setText(R.id.tv_content, "我是内容1\n我是内容2\n我是内容3\n我是内容4\n");
								helper.setText(R.id.tv_ticket_code, "我是券码01010104144");
							}
						});
			}
		});
		new VodCustomDialog.Builder(this).setTitle("商品详情").showDialog(R.layout.inflate_vod_custom_dialog_listview, DipPxConversion.dip2px(Test.this, 40 * 8),
				20, new VodCustomDialog.OnViewAddedListener()
				{
					@Override
					public void getView(View view)
					{
						BaseListView listView = (BaseListView) view.findViewById(R.id.listView);
						listView.setDivider(null);
						listView.setAdapter(new QuickAdapter<Object>(Test.this, R.layout.item_cash_goods_detail, new ArrayList<Object>())
						{
							@Override
							protected void convert(BaseAdapterHelper helper, Object object)
							{
								helper.setText(R.id.tv_title, "牛肉面");
								helper.setText(R.id.tv_count, "1份");
								helper.setText(R.id.tv_price, "¥200");
							}
						});
					}
				});
	}
}
